package com.imooc.springcloud;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

/**
 * @describte:远程方法
 * @program:spring-cloud-demo
 * @author:zhengdp
 * @create:2021-10-06 19:47:28
 **/
@FeignClient("auth-service")
public interface AuthService {

    @PostMapping("/login")
    @ResponseBody
    public AuthResponse login(
            @RequestParam("username")String username,
            @RequestParam("password")String password
    );

    @GetMapping("/verify")
    @ResponseBody
    public AuthResponse verify(@RequestParam("token")String token,
                               @RequestParam("username")String username);

    @PostMapping("/refresh")
    @ResponseBody
    public AuthResponse refresh(@RequestParam("refresh")String refresh);

}
